import { Entity, Column, ManyToOne, JoinColumn, PrimaryGeneratedColumn } from 'typeorm';
import { Mbill } from './mbilling.entity'; // Adjust the import path as necessary

@Entity('made_BillingDetails')
export class BillingDetails {
  @PrimaryGeneratedColumn()
  Identify: number;

  @Column({ type: 'nvarchar', length: 255 })
  Product: string;

  @Column({ type: 'nvarchar', length: 255, nullable: true })
  Unit: string;

  @Column({ type: 'decimal', nullable: true })
  Quantity1: number;

  @Column({ type: 'decimal', nullable: true })
  Quantity2: number;

  @Column({ type: 'decimal', nullable: true })
  Quantity3: number;

  @Column({ type: 'decimal', nullable: true })
  Quantity4: number;

  @Column({ type: 'decimal', nullable: true })
  Quantity5: number;

  @Column({ type: 'decimal', nullable: true })
  Quantity6: number;

  @Column({ type: 'decimal', nullable: true })
  Quantity7: number;

  @Column({ type: 'decimal', nullable: true })
  Quantity8: number;

  @Column({ type: 'decimal', nullable: true })
  Quantity9: number;

  @Column({ type: 'decimal', nullable: true })
  Quantity10: number;

  @Column({ type: 'decimal', nullable: true })
  UnitPrice: number;

  @Column({ type: 'decimal', nullable: true })
  AdditionalFee: number;

  @Column({ type: 'decimal', nullable: true })
  TotalQuantity: number;

  @Column({ type: 'decimal', nullable: true })
  TotalMoney: number;

  @Column({ type: 'nvarchar', length: 255, nullable: true })
  OrderNumber: string;

  @ManyToOne(() => Mbill, mbill => mbill.billingDetails)
  @JoinColumn({ name: 'OrderNumber', referencedColumnName: 'OrderNumber' })
  mbill: Mbill;
}
